import java.util.Arrays;
import java.util.Scanner;

import org.korifey.ffalg.NumberTheory;


public class Problem14 {
	
	public static void main(String[] args) {
		System.out.println(solve());
	}

	final static int n = 1000000;
	static long[] memoized = new long[100*n];
	
	public static long solve(long x) {
		if (x >= memoized.length) return 1 + solve(x % 2 == 0 ? x/2 : 3*x + 1);
		
		int idx = (int)x;
		
		if (memoized[idx] == 0) {
			memoized[idx] = 1 + solve(x % 2 == 0 ? x/2 : 3*x + 1);
		}
		return memoized[idx];
	}
		
	public static long solve() {
		memoized[1] = 1;
		for (int i = 2; i<n; i++) {
			solve(i);
		}
		
		int max = 0;
		for (int i = 1; i<n; i++) {
			if (memoized[i] > memoized[max]) {
				max = i;
			}
		}
		return max;
	}
	
}
